import requests

class ApiBase:
    def __init__(self,baseurl):
        self.url = baseurl
        self.session = requests.session()

    def request(self,method,path,**kwargs):
        url = f"{self.url}{path}"
        response = self.session.request(method,url,**kwargs)
        return response

    def get(self,path,**kwargs):
        return self.request("GET",path,**kwargs)

    def post(self,path,**kwargs):
        return self.request("POST",path,**kwargs)

    def delete(self,path,**kwargs):
        return self.request("DELETE",path,**kwargs)

    def put(self,path,**kwargs):
        return self.request("PUT",path,**kwargs)